<template>
<div class="layerRtb layerRtb-threecolumn">
    <three-title :title="{name:'施工团队'}"></three-title>
    <div class="layerRtb-scroll thinScroll" v-scrollHeight = "84">
        <div class="analyItem">
            <p class="analyItemTit tx-center" :class="this.pmUserInfo.amount === undefined || this.pmUserInfo.amount === null || this.pmUserInfo.amount === '' ? '' : 'analyLightGreen'">施工实力</p>
            <div class="analyItemCon" v-if="flg==1">
                    <p class="col-md-6">
                        <span class="cLightGray pr8">团队</span>
                        <span>10</span>
                    </p>
                    <p class="col-md-6">
                        <span class="cLightGray pr8">接单金额</span>
                        <span>{{this.pmUserInfo.amount ? this.pmUserInfo.amount : ''}}</span> 万
                    </p>
                    <div class="imgbox imgbox1 col-md-3" style="margin-top: 15px; position: absolute; right: 10px;top: 10px;">
                        <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/edit_img.png" title="编辑" width="20" class="fr pointer mr5" @click="flg=0">
                    </div>

            </div>
            <div class="analyItemCon" v-if="flg==0">
                <p class="col-md-6">
                    <span class="cLightGray pr8">团队</span>
                    <input type="text" class="width120 evaluateStandard" name="set_stage_info_make_type" value="">
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">接单金额</span>
                    <input type="text" class="width120 evaluateStandard" name="set_stage_info_make_type" v-model="amount"> 万
                </p>
                <div class="imgbox imgbox2 " style="margin-top: 15px; position: absolute; right: 10px;top: 10px;">
                    <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/save_img.png" title="保存" width="20" class="fl pointer mr5" name="update_stage_info_intention" @click="updUserInfoNew()">
                    <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/goback_img.png" title="返回" width="20" class="fl pointer mr5" @click="flg=1">
                </div>
            </div>
        </div>
    </div>
            <div class="analyItem">
            <p class="analyItemTit tx-center">综合</p>
            <div class="analyItemCon">
                <p class="fl">
                    <span v-if="this.pmUserInfo.amount === undefined || this.pmUserInfo.amount === null || this.pmUserInfo.amount === ''" class="circlemark circlemark-lightRed">待</span>
                    <span v-else class="circlemark circlemark-lightGreen">全</span>
                </p>
            </div>
        </div>
</div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
import { updUserInfoNew } from '../../Resources/Api/index'
export default {
    data () {
        return {
            flg: 1,
            amount: 0, // 订单金额
            pmUserInfo: {} // 用户的信息
            // makeAcreageStart: 0, // 做过面积开始值
            // makeAcreageEnd: 0, // 做过面积结束值
            // makeType: '' // 做过面积类型
        }
    },
    created () {
        this.pmUserInfo = this.$route.query.pmUserInfo
        console.log(this.pmUserInfo)
        this.amount = this.pmUserInfo.amount
    },
    methods: {
        ...mapMutations({
            setUpdatePlate: `SET_UPDATE_PLATE`
        }),
        // 修改接单金额
        updUserInfoNew () {
            updUserInfoNew({
                uid: this.leftInfo.uid,
                amountEceived: this.amount
            }).then(res => {
                if (res.data.StatusCode === 0) {
                    layer.msg('修改成功')
                    // this.setUpdatePlate()
                    this.$router.push(this.$route.matched[1].path)
                }
            }).catch(err => {
                console.log(err)
            })
        }
    },
    computed: {
        ...mapGetters(['leftInfo'])
    }
}
</script>
<style  scoped>
    .imgbox {
    position: absolute;
    right: 10px;
    top: 10px;
}
</style>
